<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <h2>👌22  </h2>
  <div>123123</div>
  <h3>888  </h3>

  <script>
    var div = document.querySelector('div')

    console.dir( div.nextElementSibling )  
    console.dir( div.previousElementSibling )  

  </script>
</body>
</html>